package com.bishe.app.modules.usersaledetail.model;

import com.alibaba.fastjson.JSON;
import com.bishe.app.modules.user.entity.User;
import com.bishe.app.modules.usersaledetail.entity.UserSaleDetail;
import lombok.Data;

/**
 * Created : 2024/3/24, 20:55
 *
 * @author : jeffrey.hu
 **/
@Data
public class UserShopSaleItem {

    private String sale;

    /**
     * 鞋店单人销售 会以 5% 的比例相乘
     */
    private String saleSingle;

//    private String yeji;
//
//    /**
//     * jianshu
//     */
//    private String jianshu;


    public static UserShopSaleItem getDefaultShopSale() {
        UserShopSaleItem userShopSaleItem = new UserShopSaleItem();
        userShopSaleItem.setSale("0");
        userShopSaleItem.setSaleSingle("0");

        return userShopSaleItem;
    }

    public static UserShopSaleItem getShopSale(UserSaleDetail saleDetail) {
        return JSON.parseObject(saleDetail.getSaleItem(), UserShopSaleItem.class);
    }


}
